package cloudoer.blog.service.impl;

import cloudoer.blog.base.BaseService;
import cloudoer.blog.entity.Menu;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("menuService")
public class MenuServiceImpl extends BaseService implements cloudoer.blog.service.MenuService {
    public List<Menu> getAll() {
        return menuMapper.selectAll();
    }

    public Menu getById(String id) {
        return menuMapper.selectByPrimaryKey(id);
    }

    public void add(Menu menu) {
        menuMapper.insertSelective(menu);
    }

    public void update(Menu menu) {
        menuMapper.updateByPrimaryKeySelective(menu);
    }

    public void delete(String id) {
        menuMapper.deleteByPrimaryKey(id);
    }
}
